import services from './service';
import { modelName } from './config';
import createCRUDModel from '/common/utils/createCRUDModel';
import { toggleControl } from './service'
import { isObject } from 'lodash'

export default createCRUDModel(modelName, services, {
    effects: {
        * toggleControl({ payload }, { call, put }) {
            const response = yield call(toggleControl, payload);
            if (isObject(response) && 200 === response.status) {
                yield put({
                    type:`fetchList`,
                    payload:{}
                });
            }
        },
    },
});
